Skip to content

test: ignore late worker exceptions in WPT runner#63106

Open
marcopiraccini wants to merge 1 commit into
nodejs:mainfrom
marcopiraccini:wpt-fixture-bug
Open

test: ignore late worker exceptions in WPT runner#63106
marcopiraccini wants to merge 1 commit into
nodejs:mainfrom
marcopiraccini:wpt-fixture-bug

Conversation

@marcopiraccini
Copy link
Copy Markdown
Contributor

Problem

WPT semantics: once done() is called the test result is final. Browsers send any later exception to window.onerror and do not fail the test. Node's WPT worker forwarded post-completion uncaughtExceptions to the parent as Worker 'error' events, which the runner reports as failures.

Affected flaky tests:

  • wpt/test-timershtml/webappapis/timers/type-long-settimeout.any.js
  • wpt/test-timershtml/webappapis/timers/type-long-setinterval.any.js

Fix

Install a no-op uncaughtException handler from inside add_completion_callback, before posting completion. Late exceptions in the worker are then swallowed, matching browser semantics. Scope is one fixture per worker (one Worker per spec), so it cannot leak into other tests.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 4, 2026
@marcopiraccini marcopiraccini marked this pull request as ready for review May 4, 2026 03:36
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.33%. Comparing base (74ccf38) to head (f3f975a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #63106   +/-   ##
=======================================
  Coverage   90.32%   90.33%           
=======================================
  Files         730      730           
  Lines      234209   234209           
  Branches    43934    43927    -7     
=======================================
+ Hits       211558   211570   +12     
+ Misses      14372    14366    -6     
+ Partials     8279     8273    -6     

see 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
@panva
Copy link
Copy Markdown
Member

panva commented May 24, 2026

You might want to update test/wpt/status/web-locks.json which has an expected uncaught rejection marked as flaky.

@panva
Copy link
Copy Markdown
Member

panva commented May 24, 2026

matching browser semantics

Can you elaborate? Is this rooted in the WPT runner browsers run, generally more context for review would be great.

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label May 24, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 24, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants